package com.olap.starter.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author WBG
 * @date 2022/9/5 9:38
 * @describe
 */
@Configuration
public class MybatisPlusConfigs {
    //注意Mybatis执行拦截器的顺序是bean注入的倒序，所以我们为了让我们自定义的拦截器在分页拦截器之前执行必须先注入分页拦截器
  /*  @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
*/
    @Bean
    public VersionInterceptor dataAuthInterceptor() {
        return new VersionInterceptor();
    }
}
